Scratch param#24140
Draft
loreball wants to merge 4 commits intobevyengine:mainfrom
Draft
Conversation
Contributor
Author
|
There was a suggestion on the original issue to make |
606bb94 to
052f442
Compare
Member
Is it possible to overcome this? Also |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Objective
Introduce a system param for collections holding scratch data.
Closes #23775
Solution
Implement two new items to
bevy_ecs:ScratchandClearableCollection.Scratchis the new system param for hodling scratch data. It holds aClearableCollectionwhich it clears on every system run.I went with a trait based solution instead of
ScratchVec<T>to prevent duplication of the capacity management code. That said I tried to not over-complicate the capacity management code itself. It currently just runs a 10 000 tick timer that resets every time the allocation capacity grows. If it runs down we try to halve the allocation size.Testing
The PR comes with 2 new tests, but I still want to benchmark how using this affects render asset extraction (which is why this pr is a draft for now).
Showcase
TODO